//
//  YAYIPatientInfoCell.m
//  YAYIDoctor
//
//  Created by hxp on 16/4/29.
//  Copyright © 2016年 hxp. All rights reserved.
//

#import "YAYIPatientInfoCell.h"

@implementation YAYIPatientInfoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

   
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self createCustomView];
    }
    return self;
}
-(void)createCustomView
{
    self.title = [UILabel new];
    self.title.font = [UIFont systemFontOfSize:font15];
    self.title.textColor = [UIColor grayColor];
    [self.contentView addSubview:self.title];
    
    self.name = [UILabel new];
    self.name.textAlignment = NSTextAlignmentRight;
    self.name.font = [UIFont systemFontOfSize:font16];
    self.name.textColor = [UIColor grayColor];
    [self.contentView addSubview:self.name];
    
    self.seprateLine = [UILabel new];
    self.seprateLine.backgroundColor = YAYICellLineColor;
    [self.contentView addSubview:self.seprateLine];

}
-(void)layoutSubviews
{
    [super layoutSubviews];
    [self.title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(20));
        make.centerY.mas_equalTo(self.contentView.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(200, 20));
    }];
    [self.name mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self.contentView.mas_right).with.offset(-20);
        make.centerY.mas_equalTo(self.contentView.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(200, 20));
    }];
    [self.seprateLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.bottom.mas_equalTo(self.contentView.mas_bottom).with.offset(0);
        make.size.mas_equalTo(CGSizeMake(SCREEN_width, 0.5));
    }];
}
@end
